<?php if(!defined('HDPHP_PATH'))exit;C('SHOW_NOTICE',FALSE);?>
<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<meta name="viewport" content="width=1000, initial-scale=1.0, maximum-scale=1.0">
	    <!-- Loading Bootstrap -->
	    <link href="http://localhost/project/shop/Static/Admin/Flat/dist/css/vendor/bootstrap.min.css" rel="stylesheet">
	    <!-- Loading Flat UI -->
	    <link href="http://localhost/project/shop/Static/Admin/Flat/dist/css/flat-ui.css" rel="stylesheet">
	    <!-- <link href="http://localhost/project/shop/Static/Admin/Flat/docs/assets/css/demo.css" rel="stylesheet"> -->
	    <link rel="shortcut icon" href="http://localhost/project/shop/Static/Admin/Flat/img/favicon.ico">
	    <script type="text/javascript" src="http://localhost/project/shop/Static/uploadify/jquery-1.8.2.min.js"></script>
	    <script type="text/javascript" src="http://localhost/project/shop/Static/Admin/js/goods_list.js"></script>
	    <script type="text/javascript">
	    var get_gid = "<?php echo $hd['get']['gid'];?>";
	    var check = "<?php echo U('check');?>";
	    </script>
	    <!-- HTML5 shim, for IE6-8 support of HTML5 elements. All other JS at the end of file. -->
	    <!--[if lt IE 9]>
	      <script src="dist/js/vendor/html5shiv.js"></script>
	      <script src="dist/js/vendor/respond.min.js"></script>
	    <![endif]-->
	</head>
	<body>
		<form action="<?php echo U('GoodsList/add_goods_list');?>" method="post">
		<table class="table table-hover">
			<tr class="active">
			  <th width="100">glid</th>
			  	<?php foreach ($g_spec_data as $k=>$v){?>
			  		<th><?php echo $k;?></th>
				<?php }?>
			  <th>库存</th>
			  <th>货号</th> 
			  <th width="210">操作</th>
			  <th><input type="submit" value="添加" class="btn btn-sm btn-primary"></th>
			</tr>
			<?php foreach ($gl_data as $k=>$v){?>
				<tr>
					<td><?php echo $v['glid'];?></td> 
					<?php foreach ($v['spec'] as $key=>$value){?>
						<td><?php echo $value;?></td>
					<?php }?>	
					<td><?php echo $v['inventory'];?></td>
					<td><?php echo $v['number'];?></td> 
					<td> 
						<a href="<?php echo U('GoodsList/edit_goods_list',array('glid'=>$v['glid'],'gid'=>$v['goods_gid']));?>" class="btn btn-sm btn-warning">编辑</a>

						<a href="javascript:void(0)" onclick="if(confirm('确定删除吗?')) location.href='<?php echo U('GoodsList/del_goods_list',array('glid'=>$v['glid'],'gid'=>$v['goods_gid']));?>'"; class="btn btn-sm btn-danger">删除</a>
					</td>
				</tr>
			<?php }?>

			<tr>
				<td>添加货品</td>
				<?php foreach ($g_spec_data as $key=>$value){?>
				<td>
					<div class="form-group"> 
						<select name="spec[]" class="form-control">
						<option value="0">请选择</option>
							<?php foreach ($g_spec_data[$key] as $k=>$v){?> 
								<option value="<?php echo $v['gaid'];?>"><?php echo $v['gavalue'];?></option>
							<?php }?>
						</select>
					</div>

				</td>
				<?php }?>
				<td><input id="exampleInputEmail1" class="form-control" type="text" placeholder="请输入库存"  name="inventory"></td>
				<td><input id="exampleInputEmail1" class="form-control" type="text" placeholder="货号"  name="number"></td> 

				<td></td>
			</tr>

		</table>
		<input type="hidden" name="goods_gid" value="<?php echo $hd['get']['gid'];?>"> 
		</form>

		

	</body>
</html>
